package com.zsk.wms.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zsk.wms.util.SSOClientUtil;

@Controller
public class LoginController {
    @PostMapping("/loginOut")
    @ResponseBody
    public void loginOut(HttpSession session) {
        session.invalidate();
    }

    @GetMapping("/")
    public String index(Model model) {
        model.addAttribute("loginOutUrl", SSOClientUtil.getServerLogOutUrl());
        return "main";
    }
}
